﻿<Window x:Class="SolickManagerV3_4.Windows.ListAssembliesWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:SolickManagerV3_4.Windows"
        mc:Ignorable="d"
        Icon="Images/SolulCompIcon.ico"
        WindowStartupLocation="CenterOwner"
        Title="SoulComp Manager" Height="640" Width="980">
    <Grid>
        <Border Background="White"
                        CornerRadius="10"
                        MinWidth="940"
                        MinHeight="580"
                        BorderThickness="0"
                        Margin="20 20 20 20"
                        Padding="0 20 0 0">

            <DataGrid Style="{DynamicResource DataGridSolickStyle}" AutoGenerateColumns="False" 
                              HeadersVisibility="Column"
                              IsReadOnly="true"
                              ItemsSource="{Binding Products}"
                              SelectedItem="{Binding SelectedProduct}"
                              HorizontalAlignment="Left"
                              MinWidth="940"
                              Width="auto"
                              Height="auto"
                              HorizontalGridLinesBrush="Transparent"
                              VerticalGridLinesBrush="Transparent">
                <DataGrid.ColumnHeaderStyle>
                    <Style TargetType="{x:Type DataGridColumnHeader}">
                        <Setter Property="Background" Value="#3993DD"/>
                        <Setter Property="Foreground" Value="White"/>
                        <Setter Property="HorizontalAlignment" Value="Stretch"/>
                        <Setter Property="HorizontalContentAlignment" Value="Center"/>
                        <Setter Property="VerticalContentAlignment" Value="Center"/>
                        <Setter Property="Padding" Value="5 1"/>
                    </Style>
                </DataGrid.ColumnHeaderStyle>
                <DataGrid.CellStyle>
                    <Style TargetType="{x:Type DataGridCell}">
                        <Setter Property="VerticalContentAlignment" Value="Center"/>
                        <Setter Property="VerticalAlignment" Value="Center"/>
                        <Setter Property="FontFamily" Value="Inter"/>
                        <Setter Property="FontSize" Value="11"/>

                        <Style.Triggers>
                            <Trigger Property="IsSelected" Value="True" >
                                <Setter Property="Background" Value="#24FFE9" />
                                <Setter Property="Foreground" Value="Black" />

                                <Setter Property="BorderThickness" Value="0"/>
                            </Trigger>

                            <Trigger Property="IsMouseOver" Value="True">
                            </Trigger>
                        </Style.Triggers>
                    </Style>
                </DataGrid.CellStyle>
                <DataGrid.RowStyle>
                    <Style TargetType="{x:Type DataGridRow}">
                        <Setter Property="BorderThickness" Value="0"/>
                        <Setter Property="Background" Value="White"/>
                        <Setter Property="VerticalContentAlignment" Value="Center"/>
                        <Setter Property="FontFamily" Value="Inter"/>
                        <Setter Property="FontSize" Value="11"/>

                        <Style.Triggers>
                            <Trigger Property="IsSelected" Value="True">
                                <Setter Property="Background" Value="#24FFE9"/>
                                <Setter Property="Foreground" Value="Black"/>
                            </Trigger>

                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Background" Value="#B5FFF8" />
                                <Setter Property="Foreground" Value="Black" />

                                <Setter Property="BorderThickness" Value="0"/>
                            </Trigger>
                        </Style.Triggers>
                    </Style>
                </DataGrid.RowStyle>
                <DataGrid.Columns>
                    <DataGridTextColumn Width="60*" ElementStyle="{DynamicResource StyleDataGridTextColumn}" Header="Код" Binding="{Binding Id}"/>
                    <DataGridTextColumn Width="180*" ElementStyle="{DynamicResource StyleDataGridTextColumn}" Header="Модель" Binding="{Binding Model}"/>
                    <DataGridTextColumn Width="120*" ElementStyle="{DynamicResource StyleDataGridTextColumn}" Header="Категория" Binding="{Binding IdcategoryNavigation.Title}"/>
                    <DataGridTextColumn Width="120*" ElementStyle="{DynamicResource StyleDataGridTextColumn}" Header="Поставщик" Binding="{Binding IdshipmentNavigation.ProviderTitle}"/>
                    <DataGridTextColumn Width="280*" ElementStyle="{DynamicResource StyleDataGridTextColumn}" Header="Описание" Binding="{Binding Description}"/>
                    <DataGridTextColumn Width="80*" ElementStyle="{DynamicResource StyleDataGridTextColumn}" Header="На складе" Binding="{Binding Amount}"/>
                    <DataGridTextColumn Width="100*" ElementStyle="{DynamicResource StyleDataGridTextColumn}" Header="Стоимость" Binding="{Binding CostView}"/>
                </DataGrid.Columns>
                <DataGrid.ContextMenu>
                    <ContextMenu>
                        <MenuItem Header="Выбрать" Click="AddProductInGroup"/>
                    </ContextMenu>
                </DataGrid.ContextMenu>
            </DataGrid>
        </Border>

        <Grid Height="34" VerticalAlignment="Top" Margin="20 5 10 0">
            <Label Content="Товары" 
                           FontFamily="Assets/Inter/#Inter-V.ttf"
                           FontSize="22"
                           Margin="10 0 0 0"
                           HorizontalAlignment="Left"/>
            <StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
                <TextBlock Text="Поиск"
                                       FontSize="16"
                                       VerticalAlignment="Bottom"
                                       Margin="0 0 10 0"
                                       FontFamily="Inter"
                                       FontWeight="Medium"/>
                <TextBox Text="{Binding SearchText, UpdateSourceTrigger=PropertyChanged}"
                                     Style="{DynamicResource RoundTextBox}"
                                     Height="24"
                                     VerticalAlignment="Bottom"
                                     FontSize="14"
                                     FontFamily="Inter"
                                     FontWeight="Light"
                                     Width="140"
                                     BorderThickness="1"/>
            </StackPanel>
        </Grid>
    </Grid>

</Window>
